﻿(function () {
    window.onload = function () {

        // Creating a map
        var options = {
            zoom: 5,
            center: new google.maps.LatLng(36.1834, -117.4960),
            mapTypeId: google.maps.MapTypeId.ROADMAP
        };
        var map = new google.maps.Map(document.getElementById('map'), options);

        var marker1 = new google.maps.Marker({
            position: new google.maps.LatLng(37.7671, -122.4206),
            map: map,
            title: 'Deceptions',
            icon: '/Images/transformer/deception_sm.png'
        });

        var marker2 = new google.maps.Marker({
            position: new google.maps.LatLng(33.478418, -112.079988),
            map: map,
            title: 'Autobots',
            icon: '/Images/transformer/autobots_sm.png'
        });

        // Creating an array that will contain the points for the polyline
        var route = [
            new google.maps.LatLng(37.7671, -122.4206),
            new google.maps.LatLng(34.0485, -118.2568),
            new google.maps.LatLng(36.129002, -115.173218),
            new google.maps.LatLng(33.478418, -112.079988),
            new google.maps.LatLng(39.763158, -104.989686),
            new google.maps.LatLng(37.7671, -122.4206)
        ];

        // Creating the polyline object
        var polyline = new google.maps.Polyline({
            path: route,
            strokeColor: "#008000",
            strokeOpacity: 0.6,
            strokeWeight: 5
        });

        // Adding the polyline to the map
        polyline.setMap(map);

    };
})();
